<?php
  class Contact_m extends Model{
      function Contact_m(){
          parent::Model();
          $this->load->database();
      }
      function get_all_contact($per_page,$offset){
            $this->db->select();
            $this->db->from('contact');
            $this->db->order_by('id','DESC');
            $this->db->limit($per_page,$offset);
            $query=$this->db->get();
            return $query->result_array();
        }  
        function delete_contact($id){
            return $this->db->delete('contact',array('id'=>$id));        
        }
        function get_contact($id){
    $query = $this->db->get_where('contact', array('id'=>$id)); 
         return $query->row_array();  
      }
  }
      ?>